package org.jmh.gift.client;

import org.jmh.gift.fallback.GiftClientFallback;
import org.jmh.gift.util.AjaxResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Map;
import java.util.Set;

@FeignClient(value = "gift-gift",fallback = GiftClientFallback.class)
public interface GiftClient {

    @GetMapping("/goodsSku/{id}")
    AjaxResult get(@PathVariable("id")Long id);

    @PostMapping("/goodsSku/skuIds")
    AjaxResult getSkuByIds(@RequestBody Set<Long> skuIds);

    @PutMapping("/goodsSku/sub/lockStock")
    AjaxResult subLockStock(@RequestBody Map<Long, Integer> skuInfos);

}